package hyy_2022;

import java.util.Arrays;

public class _0902_Offer3_FindRepeatNumber {

    public int findRepeatNumber(int[] nums) {
        Arrays.sort(nums);
        int i = 0;
        while(i< nums.length) {
            if(nums[i] == nums[i+1]) {
                return nums[i];
            }
            i++;
        }
        return -1;
    }
}
